package ArrayTest;
/*
方法的参数是数组时
 */
public class ArrayTest3 {
    public static void main(String[] args){
        //各种方式给方法传递数组
        int[] arr = new int[5];
        printArray(arr);
        System.out.println("=======================");
        int[] arr1 = {1,2,3,4,5};
        printArray(arr1);
        System.out.println("=======================");
        printArray(new int[5]);
        System.out.println("=======================");
        printArray(new int[]{12,3,545,6});
    }
    public static void printArray(int[] arr){
        for(int i = 0; i < arr.length; i++){
            System.out.println(arr[i]);
        }
    }
}
